/*
 * @lc app=leetcode.cn id=1217 lang=typescript
 *
 * [1217] 玩筹码
 */

// @lc code=start
function minCostToMoveChips(position: number[]): number {
    let odd = 0;
    let even = 0;
    position.forEach((i) => {
        if (i % 2) {
            odd++;
        } else {
            even++;
        }
    });
    return Math.min(odd, even);
}
// @lc code=end
